﻿<%@ Page Title="Data Management - TRAFFIC" Language="C#" MasterPageFile="~/admin.master"
    AutoEventWireup="true" Inherits="MediaMonitor.Admin.Data_Mgmt_Traffic" Theme="default"
    CodeBehind="data-mgmt-traffic.aspx.cs" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
   </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="Server">
    <telerik:RadAjaxPanel ID="radPanel" runat="server" RestoreOriginalRenderDelegate="false">

    
    <div>
        Click the
        <img src="../App_Themes/default/cssimg/exapand.png" style="display: inline;" />
        link at the left side of records to expand the data.
        <br />
    </div>
    
        <telerik:RadGrid ID="radGrid" runat="server" AllowFilteringByColumn="false" AllowPaging="True"  
            AllowSorting="True" GridLines="None" Skin="Hay" OnNeedDataSource="radGrid_NeedDataSource"
            AutoGenerateColumns="False" PageSize="50" OnDeleteCommand="radGrid_DeleteCommand">
            <MasterTableView DataKeyNames="DateAdded" >
                <Columns>
                    <telerik:GridButtonColumn Text="Delete" ButtonType="LinkButton" ConfirmText="Are you sure to delete this record?"
                        ConfirmTitle="Delete Confirmation" CommandName="Delete" ItemStyle-Width="50"  />
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="DateAdded" HeaderText="Date"
                        HtmlEncode="false" DataFormatString="{0:d}" ItemStyle-Font-Size="Larger" ItemStyle-BackColor="#575757"
                        ItemStyle-ForeColor="White" ItemStyle-Font-Bold="true"/>
                </Columns>
                <DetailTables>
                    <telerik:GridTableView DataSourceID="sqlDSTraffic" PageSize="15" AllowFilteringByColumn="true"
                        AllowSorting="true" AllowPaging="true" DataKeyNames="TrafficLogID">
                        <ParentTableRelation>
                            <telerik:GridRelationFields MasterKeyField="DateAdded" DetailKeyField="DateAdded"  />
                        </ParentTableRelation>
                        <Columns>
                            <telerik:GridButtonColumn Text="Delete" ButtonType="LinkButton" ConfirmText="Are you sure to delete this record?"
                                ConfirmTitle="Delete Confirmation" CommandName="Delete" />
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="DateAdded" HeaderText="Date"
                                HtmlEncode="false" DataFormatString="{0:d}" AllowFiltering="false"/>
                           
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="MediaName" HeaderText="Media Name" AllowFiltering="true"/>
                             <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="MediaCode" HeaderText="Media Code" AllowFiltering="true"/>
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="Monday" HeaderText="Monday" AllowFiltering="true"/>
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="Tuesday" HeaderText="Tuesday" AllowFiltering="true"/>
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="Wednesday" HeaderText="Wednesday" AllowFiltering="true"/> 
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="Thursday" HeaderText="Thursday" AllowFiltering="true"/>
                           <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="Friday" HeaderText="Friday" AllowFiltering="true"/> 
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="Saturday" HeaderText="Saturday" AllowFiltering="true"/>
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="Sunday" HeaderText="Sunday" AllowFiltering="true"/>
                        </Columns>
                    </telerik:GridTableView>
                </DetailTables>
            </MasterTableView>
            <ClientSettings>
                <Scrolling AllowScroll="false" />
                <ClientEvents OnFilterMenuShowing="filterMenuShowing" />
            </ClientSettings>
            <FilterMenu OnClientShowing="MenuShowing" />
        </telerik:RadGrid>
    </telerik:RadAjaxPanel>
     <asp:SqlDataSource ID="sqlDSTraffic" runat="server" ConnectionString="<%$ ConnectionStrings:DBAdex %>"
         SelectCommand="SELECT * FROM vTrafficLog" >
     
    </asp:SqlDataSource>
</asp:Content>
